/**
 * API相关类型定义
 */

// 通用响应结构
export interface ApiResponse<T = any> {
  code: number;
  message: string;
  data: T;
}

// 添加Response接口作为ApiResponse的别名
export interface Response<T = any> extends ApiResponse<T> {}

// 分页数据结构
export interface PaginationData<T = any> {
  list: T[];
  total: number;
  page: number;
  pageSize: number;
}

// 酒店信息
export interface Hotel {
  id: string;
  name: string;
  address: string;
  city: string;
  district: string;
  price: number;
  discount?: number;
  rating: number;
  imageUrl: string;
  tags: string[];
  latitude?: number;
  longitude?: number;
  facilities?: string[];
  description?: string;
  images: string[];
  starRating: number;
  location?: {
    lat: number;
    lng: number;
  };
}

// 房间信息
export interface Room {
  id: string;
  hotelId: string;
  name: string;
  price: number;
  discount?: number;
  maxGuests: number;
  bedType: string;
  area: number;
  floor?: string;
  wifi: boolean;
  breakfast: boolean;
  imageUrls: string[];
  facilities?: string[];
  cancellationPolicy?: string;
}

// 订单信息
export interface Order {
  id: string;
  hotelId: string;
  hotelName: string;
  roomId: string;
  roomName: string;
  checkInDate: string;
  checkOutDate: string;
  nights: number;
  guests: number;
  guestName: string;
  contactPhone: string;
  status: 'pending' | 'confirmed' | 'cancelled' | 'completed';
  createTime: string;
  totalPrice: number;
  discountPrice?: number;
  finalPrice: number;
  couponId?: string;
}

// 用户信息
export interface User {
  id: string;
  username: string;
  nickname?: string;
  avatar?: string;
  gender?: 'male' | 'female' | 'other';
  phone?: string;
  email?: string;
  birthday?: string;
}

// 常用联系人
export interface Contact {
  id: string;
  name: string;
  phone: string;
  email?: string;
  isDefault?: boolean;
  userId?: string;
  createTime?: string;
  updateTime?: string;
}

// 优惠券
export interface Coupon {
  id: string;
  title: string;
  description: string;
  type: 'discount' | 'cash';
  value: number;
  minConsumption?: number;
  startTime: string;
  endTime: string;
  status: 'valid' | 'used' | 'expired';
  name: string;
  used: boolean;
  endDate: string;
  minAmount: number;
  restrictions?: string[];
}

// 添加酒店评价类型
export interface HotelReview {
  id: string;
  userId: string;
  username: string;
  avatar?: string;
  rating: number;
  comment: string;
  images?: string[];
  createTime: string;
  tags?: string[];
} 